package ar.edu.unq.wannaplay.panels.project;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.ListMultipleChoice;
import org.apache.wicket.markup.html.panel.Panel;

import ar.edu.unq.wannaplay.dtos.EmployeeDTO;
import ar.edu.unq.wannaplay.dtos.ProjectDTO;
import ar.edu.unq.wannaplay.dtos.SkillDTO;

public class SingleProjectViewPanel extends Panel {

    private static final long serialVersionUID = 1L;

    private ProjectDTO modelObject;

    public SingleProjectViewPanel(final String id, final ProjectDTO modelObject) {
        super(id);
        this.modelObject = modelObject;
        this.initialize();
    }

    private void initialize() {

        this.add(new Label("name", this.getModelObject().getName()));
        this.add(new Label("interval", this.getModelObject().getInterval().toString()));
        this.add(new Label("manHour", ((Integer) this.getModelObject().getManHour()).toString()));
        this.add(new ListMultipleChoice<EmployeeDTO>("employeeList", this.getModelObject().getEmployees()));

        this.add(new ListMultipleChoice<SkillDTO>("skillList", this.getModelObject().getRequirements()));
    }

    public ProjectDTO getModelObject() {
        return modelObject;
    }

    public void setModelObject(final ProjectDTO modelObject) {
        this.modelObject = modelObject;
    }
}
